package com.zhuangjie.order.service.impl;

import com.zhuangjie.order.entity.OrderAmount;
import com.zhuangjie.order.enums.OrderState;
import com.zhuangjie.order.mapper.OrderAmountMapper;
import com.zhuangjie.order.service.OrderAmountService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhuangjie.order.vo.ShopProfitForShopOrderAccountingVO;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * <p>
 * 订单金额详细表 服务实现类
 * </p>
 *
 * @author zhuangjie
 * @since 2024-03-30
 */
@Service
public class OrderAmountServiceImpl extends ServiceImpl<OrderAmountMapper, OrderAmount> implements OrderAmountService {

    @Override
    public BigDecimal getOrderActualDeliveryFee(Long orderId) {
        return this.baseMapper.queryOrderActualDeliveryFee(orderId);
    }

    @Override
    public ShopProfitForShopOrderAccountingVO queryShopOrderProfitForAccounting(Long orderId) {
        return this.baseMapper.queryShopOrderProfitForAccounting(orderId, OrderState.ORDER_COMPLETED);
    }
}
